home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-23 | 1.2 KB | 60 lines | [TEXT/PJMM] |
- unit MyHandleQuitBoth;
-
- interface
-
- procedure InitQuitBoth (creator: OSType; both_index, justus_index: integer);
- procedure FinishQuitBoth;
-
- implementation
-
- uses
- MyTypes, BaseGlobals, MyProcesses, MyFMenus;
-
- var
- quitBoth: boolean;
- creatorType: OSType;
- both, justus: integer;
-
- procedure DoQuit;
- begin
- quitNow := true;
- if quitBoth then begin
- QuitApplication(creatorType, application);
- end;
- end;
-
- procedure SetQuit (themenu, theitem: integer);
- var
- dummyb: boolean;
- er: eventRecord;
- nqb: boolean;
- process: processSerialNumber;
- s: str255;
- fs: FSSpec;
- begin
- dummyb := GetOSEvent(0, er);
- nqb := (BAND(er.modifiers, optionKey) <> 0) & FindProcess(creatorType, application, process, fs);
- if nqb <> quitBoth then begin
- quitBoth := nqb;
- if quitBoth then
- GetIndString(s, global_strh_id, both)
- else
- GetIndString(s, global_strh_id, justus);
- SetItem(GetMHandle(themenu), theitem, s);
- end;
- end;
-
- procedure InitQuitBoth (creator: OSType; both_index, justus_index: integer);
- begin
- quitBoth := false;
- creatorType := creator;
- both := both_index;
- justus := justus_index;
- SetFBoth(CQuit, @DoQuit, @SetQuit);
- end;
-
- procedure FinishQuitBoth;
- begin
- end;
-
- end.